define(function(){
    return function(goodsMsg,check){
        let arr = [];
        for(let j = goodsMsg.length-1; j >=0; j--){
            if(goodsMsg[j].flag){
            arr.push(goodsMsg[j].id);
            goodsMsg.splice(j,1);
            }
        }
        for(let i = 0; i <check.length; i++){
            const id=check[i].parentNode.parentNode.getAttribute("index");
            arr.forEach((val,index)=>{
                if(id == val){
                    check[i].parentNode.parentNode.remove();
                }
            })
        }
        
        localStorage.setItem("goodsMsg",JSON.stringify(goodsMsg));
    }
})